package org.linlinjava.litemall.admin;

import cn.xuyanwu.spring.file.storage.EnableFileStorage;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
//import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.annotation.PostConstruct;
import java.time.LocalDateTime;
import java.util.TimeZone;
@EnableFileStorage // 文件上传工具
//@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages = {"org.linlinjava.litemall"},exclude = {DataSourceAutoConfiguration.class})
@MapperScan("org.linlinjava.litemall.db.dao")
@EnableTransactionManagement
@EnableScheduling
public class LitemallAdminApplication {

    @Value("${sys.datetime}")
    public String SysDateTime;

    @Value("${sys.timezone}")
    public String SysTimezone;

    @Value("${sys.localtime}")
    public String Syslocaltime;

    @PostConstruct
    public void init() {
        TimeZone.setDefault(TimeZone.getTimeZone(SysDateTime));
        System.err.println(SysTimezone+" ："+SysDateTime);
        System.err.println(Syslocaltime+" ："+ LocalDateTime.now());
    }

    public static void main(String[] args) {
        SpringApplication.run(LitemallAdminApplication.class, args);
    }


}
